package org.qqcui.designpattern.patterns.command;

/**
 * desc
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/6 11:14
 **/
public class LightOffCommand implements Command {

    private LightReceiver lightReceiver;

    public LightOffCommand(LightReceiver lightReceiver) {
        this.lightReceiver = lightReceiver;
    }

    @Override
    public void execute() {
        lightReceiver.off();
    }

    @Override
    public void undo() {
        lightReceiver.on();
    }
}
